package com.java.service.Impl;

import com.java.bean.Car;
import com.java.mapper.CarMapper;
import com.java.service.CarService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("CarServiceImpl")
public class CarServiceImpl implements CarService {
    @Autowired
    private CarMapper carMapper;

    public void setCarMapper(CarMapper carMapper) {
        this.carMapper = carMapper;
    }

    public int addCar(Car car) {
        return carMapper.addCar(car);
    }

    @Override
    public int deleteCar(@Param("id") Integer id) {
        return carMapper.deleteCar(id);
    }

    public int updateCar(Car car) {
        return carMapper.updateCar(car);
    }

    public Car selectCarByid(@Param("id") Integer id) {
        return carMapper.selectCarByid(id);
    }

    public List<Car> selectAll() {
        return carMapper.selectAll();
    }

    @Override
    public Car authenticate(String adminname, String password) {
        return null;
    }
}
